using System.Collections;
using System.Collections.Generic;
using UnityEngine;


// [CreateAssetMenu(fileName = "TestSpawnBoom", menuName = "BuffSystem/TestSpawnBoom")]
public class TestSpawnBoom : BaseBuffModule
{
    public GameObject prefab;

    public Vector3 localPosition;

    public Vector3 get_random_position(Vector3 pos, float scale = 1.0f)
    {
        pos = pos * scale;
        return new Vector3(Random.Range(-pos.x, pos.x), Random.Range(-pos.y, pos.y), Random.Range(-pos.z, pos.z));
    }
    public override void Apply(BuffInfo buffInfo, DamageInfo damageInfo = null)
    {
        var gameObject = GameObject.Instantiate(prefab, buffInfo.target.transform);
        // gameObject.transform.localPosition = localPosition;
        gameObject.transform.localPosition = get_random_position(localPosition);
    }
}
